package cc.verywell.pureblock.msg.nfs.idx.extraDownload;
/**
* 
* Copyright © 2020 TanYaqiu. All rights reserved.
* @author TanYaqiu 
* @address flat 601
* @date 2020年2月2日 下午3:30:40
*/
public final class DltoolPosLen implements Comparable<DltoolPosLen> {

	public final long pos;
	public final long len;
	public DltoolPosLen(long pos, long len) {
		this.pos = pos;
		this.len = len;
	}
	
	@Override
	public int hashCode() {
		return Long.hashCode(pos);
	}
	
	@Override
	public boolean equals(Object obj) {
        if (obj instanceof DltoolPosLen) {
        	DltoolPosLen p = (DltoolPosLen)obj;
            return pos == p.pos && len==p.len;
        }
        return false;
	}

	@Override
	public int compareTo(DltoolPosLen o) {
		if(pos==o.pos) {
			return len==o.len?0:len>o.len?1:-1;
		};
		return pos>o.pos?1:-1;
	}
	
	@Override
	public String toString() {
		return Long.toString(pos)+"+"+Long.toString(len);
	}

}
